In this How To we are going to build tcl 8.3.0 with our GCC/G++ 4.8.2 cross-compiler. Be sure to start this build in a new terminal/tab to avoid any pollution from previous builds.
Tar Balls
Here is a list of source packages that we'll need for the build. You can either download them now or wait 'til later in the How To.
I recommend creating a workspace under your /home/<your user>/ directory that is dedicated to this build. So let's fire up your terminal and run the following:
NOTE: Depending on whether you are using a cross-compiler built from my other wikis you might need to change INSTALLDIR to point to your cross-compiler.
Build Tcl
I had to make some changes for tcl to cross-compile on my machine. You can find my patch here. First try to build tcl for yourself without the patch. If the build fails then try my patch.
$ cd ../build/
!!! Need to modify configure !!!
$ cp <path to where you saved the patch>/configure.patch ../src/tcl8.3.0/unix/
$ pushd ../src/tcl8.3.0/unix/
$ patch < configure.patch
$ popd
$ ../src/tcl8.3.0/unix/./configure --prefix=/home/<your user>/workbench/tcl/final --host=$TARGETMACH
$ make
$ make install
Output
cd into the final directory and output its contents:
$ cd ../final/
$ ls
You should have the following directories:
bin
include
lib
man
Make sure the binaries are for ARM:
$ cd bin/
$ file tclsh8.3
bash: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped
If you see something similar to above you're good to go ;-)
Lastly, move the contents of these directories, or the directories themselves if they do not already exist, to your custom Linux file system or dev board. For tcl, the files should go under /usr.
My Patch
Copy the contents below into a text file and name the file configure.patch
--- org/configure 2000-02-10 06:09:57.000000000 -0500+++ new/configure 2013-12-31 23:53:09.883734000 -0500@@ -3062,7 +3062,7 @@
if test "$tcl_ok" = 0; then
test -n "$verbose" && echo " Adding strtod.o."
- LIBOBJS="$LIBOBJS strtod.o"+# LIBOBJS="$LIBOBJS strtod.o"
fi
#--------------------------------------------------------------------
@@ -4568,7 +4568,7 @@
# results, and the version is kept in special file).
if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then
- system=MP-RAS-`awk '{print }' /etc/.relid'`+ system=MP-RAS-`awk '{print }' /etc/.relid`
fi
if test "`uname -s`" = "AIX" ; then
system=AIX-`uname -v`.`uname -r`
@@ -5567,7 +5567,7 @@
# results, and the version is kept in special file).
if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then
- system=MP-RAS-`awk '{print }' /etc/.relid'`+ system=MP-RAS-`awk '{print }' /etc/.relid`
fi
if test "`uname -s`" = "AIX" ; then
system=AIX-`uname -v`.`uname -r`
How To Build Tool Command Language for ARM
Intro
In this How To we are going to build tcl 8.3.0 with our GCC/G++ 4.8.2 cross-compiler. Be sure to start this build in a new terminal/tab to avoid any pollution from previous builds.
Tar Balls
Here is a list of source packages that we'll need for the build. You can either download them now or wait 'til later in the How To.
Create a Workspace
I recommend creating a workspace under your /home/<your user>/ directory that is dedicated to this build. So let's fire up your terminal and run the following:
Gather the Sources
Now that we have a workspace created and we are currently in the src directory we can begin bringing down the sources and extracting them.
tcl
Build Environment
To make things a little smoother let's setup some environment variables:
$ export INSTALLDIR=~/workbench/gcc-g++-4.8.2/arm $ export PATH=$INSTALLDIR/bin:$PATH $ export TARGETMACH=arm-none-linux-gnueabi $ export BUILDMACH=i686-pc-linux-gnu $ export CROSS=arm-none-linux-gnueabi $ export CC=${CROSS}-gcc $ export LD=${CROSS}-ld $ export AS=${CROSS}-as $ export CXX=${CROSS}-g++NOTE: Depending on whether you are using a cross-compiler built from my other wikis you might need to change INSTALLDIR to point to your cross-compiler.Build Tcl
I had to make some changes for tcl to cross-compile on my machine. You can find my patch here. First try to build tcl for yourself without the patch. If the build fails then try my patch.
Output
cd into the final directory and output its contents:
You should have the following directories:
Make sure the binaries are for ARM:
If you see something similar to above you're good to go ;-)
Lastly, move the contents of these directories, or the directories themselves if they do not already exist, to your custom Linux file system or dev board. For tcl, the files should go under /usr.
My Patch
Copy the contents below into a text file and name the file configure.patch